//package com.molyfun.parents.activity.common.listactivity.factory;
//
//import android.content.Context;
//import android.support.v4.app.FragmentManager;
//import android.support.v7.widget.RecyclerView;
//import android.view.LayoutInflater;
//import android.view.ViewGroup;
//
//import com.molyfun.parents.MFPApplication;
//import com.molyfun.parents.R;
//import com.molyfun.parents.activity.ask.view.TopicBriefView;
//import com.molyfun.parents.activity.common.listactivity.AbstractListFactory;
//import com.molyfun.parents.activity.common.listactivity.IResponse;
//import com.molyfun.parents.activity.common.listactivity.viewholder.HomelandViewHolder;
//import com.molyfun.parents.activity.homeland.bean.HomelandBriefBean;
//import com.molyfun.parents.rest.BaseResponse;
//import com.molyfun.parents.rest.RestClient;
//import com.molyfun.parents.rest.bean.HomelandListResponse;
//
//import retrofit2.Call;
//import retrofit2.Callback;
//import retrofit2.Response;
//
///**
// * Created by william(liuchao.hit@gmail.com).
// * Date:10/31/16.
// *
// * 今日热帖
// */
//public class HomelandChooseHotListFactory extends AbstractListFactory<HomelandBriefBean> {
//
//    public HomelandChooseHotListFactory(){
//
//    }
//
//    @Override
//    public int getTitle() {
//        return R.string.activity_title_homeland_hot_title;
//    }
//
//    @Override
//    public void getDataList(int pageNum,final IResponse responseCallback) {
//
//            Call<HomelandListResponse> call = MFPApplication.getInstance().getRestClient().getHomelandHotList(pageNum, RestClient.DEFAULT_PAGE_SIZE);
//            call.enqueue(new Callback<HomelandListResponse>() {
//                @Override
//                public void onResponse(Call<HomelandListResponse> call, Response<HomelandListResponse> response) {
//                    if (response.body() != null && response.body().getData() != null && response.body().getData() != null) {
//                        responseCallback.onResponse(response.body().getData());
//                    }
//                }
//
//                @Override
//                public void onFailure(Call<HomelandListResponse> call, Throwable t) {
//                }
//            });
//
//    }
//
//    @Override
//    public RecyclerView.ViewHolder getViewHolder(ViewGroup parent, int viewType) {
//        return new HomelandViewHolder(LayoutInflater.from(parent.getContext())
//                .inflate(R.layout.layout_homeland_brief_cell, parent, false));
//    }
//
//    @Override
//    public void bindViewHolder(final Context context, final HomelandBriefBean homelandBriefBean, RecyclerView.ViewHolder holder, final int position, FragmentManager fragmentManager) {
//        HomelandViewHolder homelandViewHolder = (HomelandViewHolder)holder;
//        homelandViewHolder.mHomelandBriefView.initData(homelandBriefBean);
//        homelandViewHolder.mHomelandBriefView.setOnTopicBriefViewCallback(new TopicBriefView.OnTopicBriefViewCallback() {
//            @Override
//            public void onTopicBriefDel() {
//                deleteData(homelandBriefBean.getId(), position);
//            }
//        });
//    }
//
//    @Override
//    public void deleteData(final String id,final int position) {
//        //[0] courseId,[1]relid
//            Call<BaseResponse> call = MFPApplication.getInstance().getRestClient().delHomeland(id);
//            call.enqueue(new Callback<BaseResponse>() {
//                @Override
//                public void onResponse(Call<BaseResponse> call, Response<BaseResponse> response) {
//
//                    if (mOnListOperationCallback != null) {
//                        mOnListOperationCallback.onDataDelete(position);
//                    }
//                }
//
//                @Override
//                public void onFailure(Call<BaseResponse> call, Throwable t) {
//
//                }
//            });
//
//
//    }
//}
